#include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    button = new QPushButton(this);
    button->move(200,0);
    button->setText("你好");
    connect(button,&QPushButton::clicked,this,&Widget::HandleClick);
}
void Widget::HandleClick()
{
    if(button->text() == "你好")
    {
        button->setText("世界!");
    }
    else
    {
        button->setText("你好");
    }
}
Widget::~Widget()
{
    delete ui;
}

